package com.sq.partner.manager.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.IFacadeUserChannelDao;
import com.sq.partner.manager.mybatis.model.ChannelDto;
import com.sq.partner.manager.mybatis.model.FacadeUserChannel;
@Repository
public class FacadeUserChannelDaoImpl extends BaseDaoImpl implements
		IFacadeUserChannelDao {

	@Override
	public void add(FacadeUserChannel channel) throws Exception {
		this.add("insertGatewayFacadeUserChannel", channel);
	}

	@Override
	public boolean delete(Long userId) throws Exception {
		// TODO Auto-generated method stub
		return this.delete("delGatewayFacadeUserChannelByUserId", userId);
	}

	@Override
	public List<ChannelDto> queryChannelsByUserid(
			FacadeUserChannel channel) throws Exception {
		List<ChannelDto> list = (List<ChannelDto>)this.queryList("queryChannelByUserid", channel);
		return list;
	}

	@Override
	public int queryUcCountByChannelCode(String channelCode) throws Exception {
		return (Integer) this.query("queryUserChannelCountByChannelCode", channelCode);
	}

}
